package com.alibaba.fastjson2.issues_1700;

import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONPath;
import com.alibaba.fastjson2.JSONReader;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;

public class Issue1700 {
    @Test
    public void test() {
        String jsonArray = "{\"dictId\":\"CN\",\"dictName\":\"China\",\"dictTypeId\":\"country\",\"level\":1,\"rank\":1,\"seqno\":\".CN.\",\"sortno\":1,\"status\":1,\"children\":[{\"dictId\":\"1\",\"dictName\":\"Jiangsu\",\"dictTypeId\":\"province\",\"level\":1,\"parentId\":\"CN\",\"rank\":2,\"seqno\":\".CN.1.\",\"sortno\":1,\"status\":1,\"children\":[{\"dictId\":\"101\",\"dictName\":\"Nanjing\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"1\",\"rank\":3,\"seqno\":\".CN.1.101.\",\"sortno\":1,\"status\":1},{\"dictId\":\"102\",\"dictName\":\"Changzhou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"1\",\"rank\":3,\"seqno\":\".CN.1.102.\",\"sortno\":2,\"status\":1},{\"dictId\":\"103\",\"dictName\":\"Wuxi\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"1\",\"rank\":3,\"seqno\":\".CN.1.103.\",\"sortno\":3,\"status\":1}]},{\"dictId\":\"2\",\"dictName\":\"Guangdong\",\"dictTypeId\":\"province\",\"level\":1,\"parentId\":\"CN\",\"rank\":2,\"seqno\":\".CN.2.\",\"sortno\":2,\"status\":1,\"children\":[{\"dictId\":\"201\",\"dictName\":\"Guangzhou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"2\",\"rank\":3,\"seqno\":\".CN.2.201.\",\"sortno\":1,\"status\":1},{\"dictId\":\"202\",\"dictName\":\"Shantou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"2\",\"rank\":3,\"seqno\":\".CN.2.202.\",\"sortno\":2,\"status\":1},{\"dictId\":\"203\",\"dictName\":\"Shenzhen\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"2\",\"rank\":3,\"seqno\":\".CN.2.203.\",\"sortno\":3,\"status\":1}]},{\"dictId\":\"3\",\"dictName\":\"Fujian\",\"dictTypeId\":\"province\",\"level\":1,\"parentId\":\"CN\",\"rank\":2,\"seqno\":\".CN.3.\",\"sortno\":3,\"status\":1,\"children\":[{\"dictId\":\"301\",\"dictName\":\"Xiamen\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"3\",\"rank\":3,\"seqno\":\".CN.3.301.\",\"sortno\":1,\"status\":1},{\"dictId\":\"302\",\"dictName\":\"Fuzhou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"3\",\"rank\":3,\"seqno\":\".CN.3.302.\",\"sortno\":2,\"status\":1}]}]}";
        String expected = "[{\"dictId\":\"101\",\"dictName\":\"Nanjing\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"1\",\"rank\":3,\"seqno\":\".CN.1.101.\",\"sortno\":1,\"status\":1}]";
        String path = "$..[?( @.dictId =='101' )]";
        assertEquals(expected, JSON.toJSONString(JSONPath.of(path).extract(JSONReader.of(jsonArray))));
        expected = "[\"CN\",\"China\",\"country\",1,1,\".CN.\",1,1,[{\"dictId\":\"1\",\"dictName\":\"Jiangsu\",\"dictTypeId\":\"province\",\"level\":1,\"parentId\":\"CN\",\"rank\":2,\"seqno\":\".CN.1.\",\"sortno\":1,\"status\":1,\"children\":[{\"dictId\":\"101\",\"dictName\":\"Nanjing\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"1\",\"rank\":3,\"seqno\":\".CN.1.101.\",\"sortno\":1,\"status\":1},{\"dictId\":\"102\",\"dictName\":\"Changzhou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"1\",\"rank\":3,\"seqno\":\".CN.1.102.\",\"sortno\":2,\"status\":1},{\"dictId\":\"103\",\"dictName\":\"Wuxi\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"1\",\"rank\":3,\"seqno\":\".CN.1.103.\",\"sortno\":3,\"status\":1}]},{\"dictId\":\"2\",\"dictName\":\"Guangdong\",\"dictTypeId\":\"province\",\"level\":1,\"parentId\":\"CN\",\"rank\":2,\"seqno\":\".CN.2.\",\"sortno\":2,\"status\":1,\"children\":[{\"dictId\":\"201\",\"dictName\":\"Guangzhou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"2\",\"rank\":3,\"seqno\":\".CN.2.201.\",\"sortno\":1,\"status\":1},{\"dictId\":\"202\",\"dictName\":\"Shantou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"2\",\"rank\":3,\"seqno\":\".CN.2.202.\",\"sortno\":2,\"status\":1},{\"dictId\":\"203\",\"dictName\":\"Shenzhen\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"2\",\"rank\":3,\"seqno\":\".CN.2.203.\",\"sortno\":3,\"status\":1}]},{\"dictId\":\"3\",\"dictName\":\"Fujian\",\"dictTypeId\":\"province\",\"level\":1,\"parentId\":\"CN\",\"rank\":2,\"seqno\":\".CN.3.\",\"sortno\":3,\"status\":1,\"children\":[{\"dictId\":\"301\",\"dictName\":\"Xiamen\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"3\",\"rank\":3,\"seqno\":\".CN.3.301.\",\"sortno\":1,\"status\":1},{\"dictId\":\"302\",\"dictName\":\"Fuzhou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"3\",\"rank\":3,\"seqno\":\".CN.3.302.\",\"sortno\":2,\"status\":1}]}],{\"dictId\":\"1\",\"dictName\":\"Jiangsu\",\"dictTypeId\":\"province\",\"level\":1,\"parentId\":\"CN\",\"rank\":2,\"seqno\":\".CN.1.\",\"sortno\":1,\"status\":1,\"children\":[{\"dictId\":\"101\",\"dictName\":\"Nanjing\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"1\",\"rank\":3,\"seqno\":\".CN.1.101.\",\"sortno\":1,\"status\":1},{\"dictId\":\"102\",\"dictName\":\"Changzhou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"1\",\"rank\":3,\"seqno\":\".CN.1.102.\",\"sortno\":2,\"status\":1},{\"dictId\":\"103\",\"dictName\":\"Wuxi\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"1\",\"rank\":3,\"seqno\":\".CN.1.103.\",\"sortno\":3,\"status\":1}]},{\"dictId\":\"2\",\"dictName\":\"Guangdong\",\"dictTypeId\":\"province\",\"level\":1,\"parentId\":\"CN\",\"rank\":2,\"seqno\":\".CN.2.\",\"sortno\":2,\"status\":1,\"children\":[{\"dictId\":\"201\",\"dictName\":\"Guangzhou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"2\",\"rank\":3,\"seqno\":\".CN.2.201.\",\"sortno\":1,\"status\":1},{\"dictId\":\"202\",\"dictName\":\"Shantou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"2\",\"rank\":3,\"seqno\":\".CN.2.202.\",\"sortno\":2,\"status\":1},{\"dictId\":\"203\",\"dictName\":\"Shenzhen\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"2\",\"rank\":3,\"seqno\":\".CN.2.203.\",\"sortno\":3,\"status\":1}]},{\"dictId\":\"3\",\"dictName\":\"Fujian\",\"dictTypeId\":\"province\",\"level\":1,\"parentId\":\"CN\",\"rank\":2,\"seqno\":\".CN.3.\",\"sortno\":3,\"status\":1,\"children\":[{\"dictId\":\"301\",\"dictName\":\"Xiamen\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"3\",\"rank\":3,\"seqno\":\".CN.3.301.\",\"sortno\":1,\"status\":1},{\"dictId\":\"302\",\"dictName\":\"Fuzhou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"3\",\"rank\":3,\"seqno\":\".CN.3.302.\",\"sortno\":2,\"status\":1}]},\"1\",\"Jiangsu\",\"province\",1,\"CN\",2,\".CN.1.\",1,1,[{\"dictId\":\"101\",\"dictName\":\"Nanjing\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"1\",\"rank\":3,\"seqno\":\".CN.1.101.\",\"sortno\":1,\"status\":1},{\"dictId\":\"102\",\"dictName\":\"Changzhou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"1\",\"rank\":3,\"seqno\":\".CN.1.102.\",\"sortno\":2,\"status\":1},{\"dictId\":\"103\",\"dictName\":\"Wuxi\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"1\",\"rank\":3,\"seqno\":\".CN.1.103.\",\"sortno\":3,\"status\":1}],{\"dictId\":\"101\",\"dictName\":\"Nanjing\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"1\",\"rank\":3,\"seqno\":\".CN.1.101.\",\"sortno\":1,\"status\":1},{\"dictId\":\"102\",\"dictName\":\"Changzhou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"1\",\"rank\":3,\"seqno\":\".CN.1.102.\",\"sortno\":2,\"status\":1},{\"dictId\":\"103\",\"dictName\":\"Wuxi\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"1\",\"rank\":3,\"seqno\":\".CN.1.103.\",\"sortno\":3,\"status\":1},\"101\",\"Nanjing\",\"city\",1,\"1\",3,\".CN.1.101.\",1,1,\"102\",\"Changzhou\",\"city\",1,\"1\",3,\".CN.1.102.\",2,1,\"103\",\"Wuxi\",\"city\",1,\"1\",3,\".CN.1.103.\",3,1,\"2\",\"Guangdong\",\"province\",1,\"CN\",2,\".CN.2.\",2,1,[{\"dictId\":\"201\",\"dictName\":\"Guangzhou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"2\",\"rank\":3,\"seqno\":\".CN.2.201.\",\"sortno\":1,\"status\":1},{\"dictId\":\"202\",\"dictName\":\"Shantou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"2\",\"rank\":3,\"seqno\":\".CN.2.202.\",\"sortno\":2,\"status\":1},{\"dictId\":\"203\",\"dictName\":\"Shenzhen\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"2\",\"rank\":3,\"seqno\":\".CN.2.203.\",\"sortno\":3,\"status\":1}],{\"dictId\":\"201\",\"dictName\":\"Guangzhou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"2\",\"rank\":3,\"seqno\":\".CN.2.201.\",\"sortno\":1,\"status\":1},{\"dictId\":\"202\",\"dictName\":\"Shantou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"2\",\"rank\":3,\"seqno\":\".CN.2.202.\",\"sortno\":2,\"status\":1},{\"dictId\":\"203\",\"dictName\":\"Shenzhen\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"2\",\"rank\":3,\"seqno\":\".CN.2.203.\",\"sortno\":3,\"status\":1},\"201\",\"Guangzhou\",\"city\",1,\"2\",3,\".CN.2.201.\",1,1,\"202\",\"Shantou\",\"city\",1,\"2\",3,\".CN.2.202.\",2,1,\"203\",\"Shenzhen\",\"city\",1,\"2\",3,\".CN.2.203.\",3,1,\"3\",\"Fujian\",\"province\",1,\"CN\",2,\".CN.3.\",3,1,[{\"dictId\":\"301\",\"dictName\":\"Xiamen\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"3\",\"rank\":3,\"seqno\":\".CN.3.301.\",\"sortno\":1,\"status\":1},{\"dictId\":\"302\",\"dictName\":\"Fuzhou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"3\",\"rank\":3,\"seqno\":\".CN.3.302.\",\"sortno\":2,\"status\":1}],{\"dictId\":\"301\",\"dictName\":\"Xiamen\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"3\",\"rank\":3,\"seqno\":\".CN.3.301.\",\"sortno\":1,\"status\":1},{\"dictId\":\"302\",\"dictName\":\"Fuzhou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"3\",\"rank\":3,\"seqno\":\".CN.3.302.\",\"sortno\":2,\"status\":1},\"301\",\"Xiamen\",\"city\",1,\"3\",3,\".CN.3.301.\",1,1,\"302\",\"Fuzhou\",\"city\",1,\"3\",3,\".CN.3.302.\",2,1]";
        path = "$..*";
        assertEquals(expected, JSON.toJSONString(JSONPath.of(path).extract(JSONReader.of(jsonArray))));
        expected = "[{\"dictId\":\"CN\",\"dictName\":\"China\",\"dictTypeId\":\"country\",\"level\":1,\"rank\":1,\"seqno\":\".CN.\",\"sortno\":1,\"status\":1,\"children\":[{\"dictId\":\"1\",\"dictName\":\"Jiangsu\",\"dictTypeId\":\"province\",\"level\":1,\"parentId\":\"CN\",\"rank\":2,\"seqno\":\".CN.1.\",\"sortno\":1,\"status\":1,\"children\":[{\"dictId\":\"101\",\"dictName\":\"Nanjing\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"1\",\"rank\":3,\"seqno\":\".CN.1.101.\",\"sortno\":1,\"status\":1},{\"dictId\":\"102\",\"dictName\":\"Changzhou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"1\",\"rank\":3,\"seqno\":\".CN.1.102.\",\"sortno\":2,\"status\":1},{\"dictId\":\"103\",\"dictName\":\"Wuxi\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"1\",\"rank\":3,\"seqno\":\".CN.1.103.\",\"sortno\":3,\"status\":1}]},{\"dictId\":\"2\",\"dictName\":\"Guangdong\",\"dictTypeId\":\"province\",\"level\":1,\"parentId\":\"CN\",\"rank\":2,\"seqno\":\".CN.2.\",\"sortno\":2,\"status\":1,\"children\":[{\"dictId\":\"201\",\"dictName\":\"Guangzhou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"2\",\"rank\":3,\"seqno\":\".CN.2.201.\",\"sortno\":1,\"status\":1},{\"dictId\":\"202\",\"dictName\":\"Shantou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"2\",\"rank\":3,\"seqno\":\".CN.2.202.\",\"sortno\":2,\"status\":1},{\"dictId\":\"203\",\"dictName\":\"Shenzhen\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"2\",\"rank\":3,\"seqno\":\".CN.2.203.\",\"sortno\":3,\"status\":1}]},{\"dictId\":\"3\",\"dictName\":\"Fujian\",\"dictTypeId\":\"province\",\"level\":1,\"parentId\":\"CN\",\"rank\":2,\"seqno\":\".CN.3.\",\"sortno\":3,\"status\":1,\"children\":[{\"dictId\":\"301\",\"dictName\":\"Xiamen\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"3\",\"rank\":3,\"seqno\":\".CN.3.301.\",\"sortno\":1,\"status\":1},{\"dictId\":\"302\",\"dictName\":\"Fuzhou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"3\",\"rank\":3,\"seqno\":\".CN.3.302.\",\"sortno\":2,\"status\":1}]}]},[{\"dictId\":\"1\",\"dictName\":\"Jiangsu\",\"dictTypeId\":\"province\",\"level\":1,\"parentId\":\"CN\",\"rank\":2,\"seqno\":\".CN.1.\",\"sortno\":1,\"status\":1,\"children\":[{\"dictId\":\"101\",\"dictName\":\"Nanjing\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"1\",\"rank\":3,\"seqno\":\".CN.1.101.\",\"sortno\":1,\"status\":1},{\"dictId\":\"102\",\"dictName\":\"Changzhou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"1\",\"rank\":3,\"seqno\":\".CN.1.102.\",\"sortno\":2,\"status\":1},{\"dictId\":\"103\",\"dictName\":\"Wuxi\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"1\",\"rank\":3,\"seqno\":\".CN.1.103.\",\"sortno\":3,\"status\":1}]},{\"dictId\":\"2\",\"dictName\":\"Guangdong\",\"dictTypeId\":\"province\",\"level\":1,\"parentId\":\"CN\",\"rank\":2,\"seqno\":\".CN.2.\",\"sortno\":2,\"status\":1,\"children\":[{\"dictId\":\"201\",\"dictName\":\"Guangzhou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"2\",\"rank\":3,\"seqno\":\".CN.2.201.\",\"sortno\":1,\"status\":1},{\"dictId\":\"202\",\"dictName\":\"Shantou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"2\",\"rank\":3,\"seqno\":\".CN.2.202.\",\"sortno\":2,\"status\":1},{\"dictId\":\"203\",\"dictName\":\"Shenzhen\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"2\",\"rank\":3,\"seqno\":\".CN.2.203.\",\"sortno\":3,\"status\":1}]},{\"dictId\":\"3\",\"dictName\":\"Fujian\",\"dictTypeId\":\"province\",\"level\":1,\"parentId\":\"CN\",\"rank\":2,\"seqno\":\".CN.3.\",\"sortno\":3,\"status\":1,\"children\":[{\"dictId\":\"301\",\"dictName\":\"Xiamen\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"3\",\"rank\":3,\"seqno\":\".CN.3.301.\",\"sortno\":1,\"status\":1},{\"dictId\":\"302\",\"dictName\":\"Fuzhou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"3\",\"rank\":3,\"seqno\":\".CN.3.302.\",\"sortno\":2,\"status\":1}]}],{\"dictId\":\"1\",\"dictName\":\"Jiangsu\",\"dictTypeId\":\"province\",\"level\":1,\"parentId\":\"CN\",\"rank\":2,\"seqno\":\".CN.1.\",\"sortno\":1,\"status\":1,\"children\":[{\"dictId\":\"101\",\"dictName\":\"Nanjing\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"1\",\"rank\":3,\"seqno\":\".CN.1.101.\",\"sortno\":1,\"status\":1},{\"dictId\":\"102\",\"dictName\":\"Changzhou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"1\",\"rank\":3,\"seqno\":\".CN.1.102.\",\"sortno\":2,\"status\":1},{\"dictId\":\"103\",\"dictName\":\"Wuxi\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"1\",\"rank\":3,\"seqno\":\".CN.1.103.\",\"sortno\":3,\"status\":1}]},[{\"dictId\":\"101\",\"dictName\":\"Nanjing\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"1\",\"rank\":3,\"seqno\":\".CN.1.101.\",\"sortno\":1,\"status\":1},{\"dictId\":\"102\",\"dictName\":\"Changzhou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"1\",\"rank\":3,\"seqno\":\".CN.1.102.\",\"sortno\":2,\"status\":1},{\"dictId\":\"103\",\"dictName\":\"Wuxi\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"1\",\"rank\":3,\"seqno\":\".CN.1.103.\",\"sortno\":3,\"status\":1}],{\"dictId\":\"101\",\"dictName\":\"Nanjing\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"1\",\"rank\":3,\"seqno\":\".CN.1.101.\",\"sortno\":1,\"status\":1},{\"dictId\":\"102\",\"dictName\":\"Changzhou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"1\",\"rank\":3,\"seqno\":\".CN.1.102.\",\"sortno\":2,\"status\":1},{\"dictId\":\"103\",\"dictName\":\"Wuxi\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"1\",\"rank\":3,\"seqno\":\".CN.1.103.\",\"sortno\":3,\"status\":1},{\"dictId\":\"2\",\"dictName\":\"Guangdong\",\"dictTypeId\":\"province\",\"level\":1,\"parentId\":\"CN\",\"rank\":2,\"seqno\":\".CN.2.\",\"sortno\":2,\"status\":1,\"children\":[{\"dictId\":\"201\",\"dictName\":\"Guangzhou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"2\",\"rank\":3,\"seqno\":\".CN.2.201.\",\"sortno\":1,\"status\":1},{\"dictId\":\"202\",\"dictName\":\"Shantou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"2\",\"rank\":3,\"seqno\":\".CN.2.202.\",\"sortno\":2,\"status\":1},{\"dictId\":\"203\",\"dictName\":\"Shenzhen\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"2\",\"rank\":3,\"seqno\":\".CN.2.203.\",\"sortno\":3,\"status\":1}]},[{\"dictId\":\"201\",\"dictName\":\"Guangzhou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"2\",\"rank\":3,\"seqno\":\".CN.2.201.\",\"sortno\":1,\"status\":1},{\"dictId\":\"202\",\"dictName\":\"Shantou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"2\",\"rank\":3,\"seqno\":\".CN.2.202.\",\"sortno\":2,\"status\":1},{\"dictId\":\"203\",\"dictName\":\"Shenzhen\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"2\",\"rank\":3,\"seqno\":\".CN.2.203.\",\"sortno\":3,\"status\":1}],{\"dictId\":\"201\",\"dictName\":\"Guangzhou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"2\",\"rank\":3,\"seqno\":\".CN.2.201.\",\"sortno\":1,\"status\":1},{\"dictId\":\"202\",\"dictName\":\"Shantou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"2\",\"rank\":3,\"seqno\":\".CN.2.202.\",\"sortno\":2,\"status\":1},{\"dictId\":\"203\",\"dictName\":\"Shenzhen\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"2\",\"rank\":3,\"seqno\":\".CN.2.203.\",\"sortno\":3,\"status\":1},{\"dictId\":\"3\",\"dictName\":\"Fujian\",\"dictTypeId\":\"province\",\"level\":1,\"parentId\":\"CN\",\"rank\":2,\"seqno\":\".CN.3.\",\"sortno\":3,\"status\":1,\"children\":[{\"dictId\":\"301\",\"dictName\":\"Xiamen\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"3\",\"rank\":3,\"seqno\":\".CN.3.301.\",\"sortno\":1,\"status\":1},{\"dictId\":\"302\",\"dictName\":\"Fuzhou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"3\",\"rank\":3,\"seqno\":\".CN.3.302.\",\"sortno\":2,\"status\":1}]},[{\"dictId\":\"301\",\"dictName\":\"Xiamen\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"3\",\"rank\":3,\"seqno\":\".CN.3.301.\",\"sortno\":1,\"status\":1},{\"dictId\":\"302\",\"dictName\":\"Fuzhou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"3\",\"rank\":3,\"seqno\":\".CN.3.302.\",\"sortno\":2,\"status\":1}],{\"dictId\":\"301\",\"dictName\":\"Xiamen\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"3\",\"rank\":3,\"seqno\":\".CN.3.301.\",\"sortno\":1,\"status\":1},{\"dictId\":\"302\",\"dictName\":\"Fuzhou\",\"dictTypeId\":\"city\",\"level\":1,\"parentId\":\"3\",\"rank\":3,\"seqno\":\".CN.3.302.\",\"sortno\":2,\"status\":1}]";
        path = "$..";
        assertEquals(expected, JSON.toJSONString(JSONPath.of(path).extract(JSONReader.of(jsonArray))));
    }
}
